package com.css.zfzx.sjcj.modules.hddcGeomorphySvyPoint.repository;

import com.css.zfzx.sjcj.modules.hddcGeomorphySvyPoint.repository.entity.HddcGeomorphysvypointEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;

/**
 * @author zyb
 * @date 2020-11-27
 */
public interface HddcGeomorphysvypointRepository extends JpaRepository<HddcGeomorphysvypointEntity, String> {
    @Modifying
    @Query(nativeQuery = true,value = "update hddc_geomorphysvypoint set qualityinspection_status=:qualityinspection_status ,extends1=:extend1 where uuid=:uuid")
    void updateStatus(@Param("qualityinspection_status") String qualityinspection_status,@Param("extend1") String extend1,@Param("uuid") String uuid);
    @Modifying
    @Query(nativeQuery = true,value = "update hddc_geomorphysvypoint set qualityinspection_status=:s ,extends2=:str where uuid=:uuid")
    void updateStatus2(String s, String str, String uuid);

    @Query(nativeQuery = true,value = "select * from hddc_geomorphysvypoint where is_valid=1 and extends10=1 ")
    List<HddcGeomorphysvypointEntity> findByAll();

    HddcGeomorphysvypointEntity findByUuidAndIsValid(String id, String isValid);
}
